from django.contrib import admin
from lbforum.models import *

from django.contrib.auth.models import User
def f(self):
    return self.username

User.__unicode__=f       


admin.site.register(Category)
    
admin.site.register(Forum)

#admin.site.register(Topic)
#admin.site.register(Post)

class LBForumUserProfileAdmin(admin.ModelAdmin):
    list_display        = ('user', 'userrank', 'last_activity', 'last_posttime', \
            'signature', )
    search_fields       = ('user', 'userrank', )

class TopicAdmin(admin.ModelAdmin):
    list_display = ('subject', 'forum', 'posted_by')
    fields = ('subject', 'posted_by', 'forum', 'created_on','sticky')
    
class PostAdmin(admin.ModelAdmin):
    list_display =('message','topic', 'posted_by', 'created_on')
    
admin.site.register(Topic, TopicAdmin)
admin.site.register(Post, PostAdmin)    
admin.site.register(LBForumUserProfile, LBForumUserProfileAdmin)
#